"use strict";
require("./ipc/index.js");
const path = require("path");
const electron = require("electron");
const { BrowserWindow, app } = electron;
function createWindow() {
  const win = new BrowserWindow({
    height: 768,
    width: 1024,
    autoHideMenuBar: true,
    title: "九合诸侯(Alliances)",
    webPreferences: {
      preload: path.resolve(__dirname, "preload.js"),
      contextIsolation: true
    }
  });
  win.loadURL("http://localhost:5173/");
}
app.whenReady().then(() => {
  createWindow();
  app.on("activate", () => {
    if (BrowserWindow.getAllWindows().length === 0) createWindow();
  });
});
app.on("window-all-closed", () => {
  if (process.platform !== "darwin") app.quit();
});
